﻿@{
    Layout = "~/Views/Shared/_FormWhite.cshtml";
}

<div class="wrapper animated fadeInRight">
    <form id="form" class="form-horizontal m">
        <div class="form-group">
            <label class="col-sm-3 control-label ">选择类型<font class="red"> *</font></label>
            <div class="col-sm-4">
                <div id="exptype"></div>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    var id = ys.request("id");
    $(function () {
        $('#form').validate({
            rules: {
                exptype: { required: true }
            }
        });

        $("#exptype").ysComboBox({
            data: [{ Id: 1, Type: '生物安全柜' }, { Id: 2, Type: '洁净工作台' }],
            key: "Id",
            value: "Type",
            class: "form-control"
        });
        $("#exptype").ysComboBox("setValue", 1);
    });

    function saveForm(index) {
        if ($('#form').validate().form()) {
            var type = $("#exptype").ysComboBox("getValue");
            switch (type) {
                case "1":
                    window.open('@Url.Content("~/ExperimentManage/ExperimentData/ExperimentDataForm")?id=0', 'newwindow');
                    break;
                case "2":
                    window.open('@Url.Content("~/ExperimentManage/ExperimentData/ExperimentCleanForm")?id=0', 'newwindow');
                    break;
            }

            parent.layer.close(index);
        }
    }
</script>

